package com.ninthgroup.mapper;

import com.ninthgroup.entity.Permission;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface PermissionMapper {
    int deleteByPrimaryKey(Integer pId);

    int insert(Permission record);

    int insertSelective(Permission record);

    Permission selectByPrimaryKey(Integer pId);

    int updateByPrimaryKeySelective(Permission record);

    int updateByPrimaryKey(Permission record);

    /**
     * @create by: Student任
     * @description:管理员用户的相关功能
     * 查询管理员的具有的菜单
     * @create time: 2022/10/14 10:33
     * @param
     * @return
     */
    List<Permission> selectByAdminId(Integer aId);

    /**
     * @create by: Student任
     * @description:用户的相关功能
     * 查询管理员的具有的菜单
     * @create time: 2022/10/14 10:33
     * @param
     * @return
     */
    List<Permission> selectByUserId(Integer uId);


    /**
     * @create by: Student任
     * @description:医生用户的相关功能
     * 查询管理员的具有的菜单
     * @create time: 2022/10/14 10:33
     * @param
     * @return
     */
    List<Permission> selectByDoctorId(Integer dId);






    /**
     * @param
     * @return
     * @create by: Student任
     * @description:查询所有权限
     * @create time: 2022/10/12 9:21
     */
    List<Permission> selectAll(String pName);

    /**
     * @param
     * @return
     * @create by: Student任
     * @description:
     * @create time: 2022/10/12 9:23
     */
    List<Integer> selectByRoleId(int roleId);

    /**
     * @param
     * @return
     * @create by: Student任
     * @description: 批量删除
     * @create time: 2022/10/12 13:29
     */
    void deleteByRoleId(Integer roleId);

    /**
     * @param
     * @return
     * @create by: Student任
     * @description: 批量添加
     * @create time: 2022/10/12 13:28
     */
    void batchPermission(@Param("roleId") Integer roleId, @Param("permissionIds") Integer[] permissionIds);



}